package com.ruoyi.web.exams.domain;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

import java.math.BigDecimal;

/**
 * 答题卡条目对象 exam_answers
 *
 * @author 范书铭
 * @date 2024-10-02
 */
@ApiModel(value =  "答题卡条目",description = "")
@TableName(resultMap = "com.ruoyi.web.exams.mapper.ExamAnswersMapper.ExamAnswersResult")
@Data
@EqualsAndHashCode(callSuper = true)
public class ExamAnswers extends BaseEntity{
    private static final long serialVersionUID = 1L;

    /** $column.columnComment */
    @TableId(value = "id",type = IdType.AUTO)
    private Long id;

    /** 答题记录ID(每次答题都有单独的记录) */
    private Long examResultId;



    /** 题目ID */
    @ApiModelProperty(name = "题目ID",notes = "")
    @Excel(name = "题目ID")
    private Long questionId;

    /** 用户答案选项ID列表,用英文逗号隔开 */
    @ApiModelProperty(name = "用户答案选项ID列表,用英文逗号隔开",notes = "")
    @Excel(name = "用户答案选项ID列表,用英文逗号隔开")
    private String userAnswerOptionIds;

    /** 用户答案选项文本(ABCD或者对/错) */
    @ApiModelProperty(name = "用户答案选项文本(ABCD或者对/错)",notes = "")
    @Excel(name = "用户答案选项文本(ABCD或者对/错)")
    private String userAnswerOptions;

    /** 选项是否为正确答案(多选如果漏选依旧是错误) */
    @ApiModelProperty(name = "选项是否为正确答案(多选如果漏选依旧是错误)",notes = "")
    @Excel(name = "答题状态: 0未作答,1答题错误,2答题正确")
    private Integer userAnswerStatus;
//    private Boolean isOptionsRight;
    /** 试卷ID */
    private Long pagerId;// 冗余-创建添加

    /** 用户ID */
    private Long userId;//  冗余-创建添加
    /**
     * 题目类型
     */
    private Long questionType;// 冗余-创建添加
    /**
     * 题目分值
     */
    private BigDecimal scoreNumber;// 冗余-创建添加
    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("examResultId", getExamResultId())
                .append("pagerId", getPagerId())
//                .append("userId", getUserId())
                .append("questionId", getQuestionId())
                .append("userAnswerOptionIds", getUserAnswerOptionIds())
                .append("userAnswerOptions", getUserAnswerOptions())
//                .append("isOptionsRight", getIsOptionsRight())
                .append("createBy", getCreateBy())
                .append("createTime", getCreateTime())
                .append("updateBy", getUpdateBy())
                .append("updateTime", getUpdateTime())
                .append("remark", getRemark())
                .toString();
    }
}